package stars.starSystems;

import java.util.ArrayList;
import java.util.HashSet;

import utilities.CoordConvert;
import view.EViewList;
import view.AbstractView;

import com.jme3.input.InputManager;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Vector2f;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.control.Control;
import com.jme3.scene.shape.Box;
import com.jme3.scene.shape.Quad;
import com.jme3.scene.shape.Sphere;
import com.jme3.texture.Texture;

import controller.IController;
import eventManager.IEventData;


/*
 * Main view of star system on galactic map
 */
public class StarSystemView extends AbstractView {
	
	//private Material material;	
		
	//private HashSet<String> inputListeners = new HashSet<String>();
	
	public StarSystemView(EViewList name) {
		super(name);
		//this.material = material;		
		//loadInputListeners();	
		//initView();
	}

	public void onAction(String arg0, boolean arg1, float arg2) {
		// TODO Auto-generated method stub
		
	}
	
	public void onAnalog(String name, float value, float tpf) {
		
	}
	
	public void registerInputListeners(InputManager inputManager) {
		//inputManager.addMapping("LEFT_CLICK", triggers)
		
		//inputListeners.add("LEFT_CLICK");
		
	}

//	public HashSet<String> getInputListeners() {
//		return this.inputListeners;
//	}

//	public void initView() {
//		String identifier = "StarSystem";//String.valueOf(this.getModel().getKeyValue());
//		Sphere star = new Sphere(32,32, 1f);
//		//Sphere star2 = new Sphere(16,16, 1f);
//		//star2.getBuffer(Type.)
//		//Sphere star3 = new Sphere(2,2, 1f);
//		geometry = new Geometry(identifier, star);
//		star.setTextureMode(Sphere.TextureMode.Projected);
//		
//		
//		
//		//geometry = new Geometry(identifier, new Quad(0.5f, 0.5f)); 
//		//geometry = new Geometry(identifier, new Box(Vector3f.ZERO, 0.5f,0.5f,0.5f));
//		geometry.setMaterial(material);	
//		geometry.rotate(1.5708f, 0, 0);
//		//geometry.setLodLevel(1);
//		
//		for (Control control : JMEControls) {
//			geometry.addControl(control);
//		}
//		
//		update();		
//	}
	
//	public void setGeometry(Geometry geometry) {
//		this.geometry = geometry;
//	}

//	public void closeView() {
//		geometry = null;
//	}

//	public Geometry getGeometry() {
//		return this.geometry;
//	}

	
	
//	public void update() {
//		StarSystemModel fullModel = (StarSystemModel) this.getModel();		
//		
//		//update location
//		ArrayList<Integer> trans = fullModel.getLocation();
//		Vector2f tempTrans = CoordConvert.hex2CartVec(trans);		
//		geometry.setLocalTranslation(new Vector3f(tempTrans.x, tempTrans.y, 0));
//	}

	
	//IView methods
//	public void executeStrategy(IEventData event) {
//		view.executeStrategy(event);
//	}
//
//	public void setController(IController controller) {
//		view.setController(controller);
//	}
//
//	public void setModel(IModel model) {
//		view.setModel(model);
//	}
//
//	public EViewList getName() {
//		return view.getName();
//	}
//
//	public IModel getModel() {
//		return view.getModel();
//	}
	

}